Final Exam

Final Exam Results

Evaluation of your answers:

  1. How are PHP extensions defined in the PHP preprocessor?

    You chose: Using the extension= statement in the php.ini file.

    Correct!

  2. What does the mysql_connect() PHP function do?

    You chose: Connect to a specified server using a specified user ID and password.

    Correct!

  3. What PHP feature allows you to save shopping cart items for individual visitors in a temporary location that keeps the information for the duration of the Web site visit?

    You chose: Session cookies.

    Correct!

  4. In the statement foreach($states as $first=>$second), which variable will hold the array key?

    You chose: $first['state']

    Incorrect. The $first['state'] variable contains individual key values and isn't an array. The correct answer is: $first. (Lesson 2, Chapter 2)

  5. How do you reference a function defined in an external file in a PHP program?

    You chose: Use the include() function to include the function code in your PHP program.

    Correct!

  6. Which PHP GD2 library function allows us to easily resize existing images?

    You chose: imagecreatetruecolor()

    Incorrect. The imagecreatetruecolor() function allows us to create a new image but not manipulate its size. The correct answer is: imagecopyresampled(). (Lesson 2, Chapter 4)

  7. What data type allows you to specify an exact number of decimal places for a number in the data field?

    You chose: Decimal.

    Correct!

  8. What advanced feature in MySQL allows you to restrict the values placed in a data field?

    You chose: Constraint.

    Correct!

  9. How is a view created?

    You chose: From the result of a SELECT query.

    Correct!

  10. What is the common term for a Web page that's separate from the normal application home page and provides administrative functions for the application?

    You chose: A back end.

    Correct!

  11. What PHP function allows you to send HTTP headers to the client browser?

    You chose: header().

    Correct!

  12. What is the area on a Web page that provides quick information about the status of the application called?

    You chose: The dashboard.

    Correct!

  13. What function should you use to prepare data before inserting it into a MySQL table?

    You chose: ob_start()

    Incorrect. You use the ob_start() function to buffer PHP output instead of sending it to the client browser but not for preparing data before inserting into a MySQL table. The correct answer is: mysql_real_escape_string(). (Lesson 5, Chapter 2)

  14. What HTML input type should you use to allow a Web page visitor to upload a file from their PC?

    You chose: The file input type.

    Correct!

  15. What PHP feature should you use to retrieve the name of the uploaded file from an HTML form?

    You chose: $_FILES[]

    Correct!

  16. What HTML tag should you use to display an image stored in a MySQL database?

    You chose: <img>

    Correct!

  17. What HTML input type allows you to easily display an on/off value for indicating the value of data that's in a Boolean data type?

    You chose: checkbox.

    Correct!

  18. What SQL statement should you use to remove a record from the database?

    You chose: DELETE.

    Correct!

  19. What function is commonly associated with the storefront application?

    You chose: Provide a way for customers to select products for purchase.

    Correct!

  20. Which printf() function special code displays a floating point value with a fixed number of decimal places?

    You chose: %f

    Correct!

  21. What PHP feature allows you to assign multiple keys to a single session cookie key?

    You chose: Multidimensional arrays.

    Correct!

  22. What array format would you use to track product as the array key and the quantity as the value?

    You chose: $_SESSION['cart'][$prodid] = $quantity

    Correct!

  23. What PHP configuration parameter do you use to set a session cookie to expire before the client's Web browser closes?

    You chose: session.cookie_lifetime

    Correct!

  24. What's the best technique to use to prevent having inventory problems while online customers shop?

    You chose: Minimize the amount of time between when the customer places an item in the shopping cart and when they check out.

    Correct!

  25. Which MySQL function should you use to encrypt data stored in a table?

    You chose: PASSWORD()

    Correct!

  26. What does the Web server send to a client browser to encrypt data?

    You chose: Its public encryption key.

    Correct!

  27. Which MySQL function should you use to retrieve the last auto_increment value assigned during the database connection?

    You chose: LAST_INSERT_ID()

    Correct!

  28. Which MySQL InnoDB database engine feature allows you to process multiple SQL statements as a single unit?

    You chose: Transactions.

    Correct!

  29. What SQL statement allows you to change the attributes or constraints of an existing data field in a table?

    You chose: ALTER

    Correct!

  30. What is the way to suppress any error messages from a PHP function and continue processing the program?

    You chose: Use the 'at' symbol (@) in front of the function.

    Correct!

  31. Which regular expression symbol do you use to match a pattern at the start of a string?

    You chose: The caret character.

    Correct!

  32. What SQL clause returns records that match the linking data field between two tables?

    You chose: WHERE t1.custid = t2.custid

    Correct!

  33. What HTTP header type do you use to set the application used to open data on the client's browser?

    You chose: Content-type.

    Correct!

  34. What OOP feature holds data values used for the class object?

    You chose: Properties.

    Correct!

  35. Which visibility keyword causes a class property to be only accessible inside the class definition code?

    You chose: Private.

    Correct!

  36. What is the process of creating a new class by extending an existing class called?

    You chose: Inheritance.

    Correct!

Your score: 92% (out of 100%). Excellent job!

Course final
Date submitted: 04/28/2015 10:56:50 AM (PDT)

Please print this evaluation for your records.